package cn.com.surker.material.service;

import cn.com.surker.material.entity.MainMaterialHistoryInventory;
import cn.com.surker.material.vo.MaterialHistoryInventoryVo;
import cn.com.surker.spring.RestResultDto;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;
import java.util.Map;

/**
 * @Author lucky
 * @create 2024年11月12 22:34
 * @desc 材料盘点历史表
 */
public interface MaterialHistoryInventoryBaseService {

    /**
     * 校正库存量
     * @param storageId 仓位ID
     * @param storeValue 校正量kg
     * @return
     */
    RestResultDto updateStoreDosage(Long orgId,Long storageId, Double initial, Double storeValue, String creator, Integer isCloud);

    /**
     * 新增历史数据(盘点、工控换材料、定时盘点)
     * @param historyInventory
     * @return
     */
    RestResultDto saveHistory(MainMaterialHistoryInventory historyInventory);

    /**
     * 分页查询盘点信息
     * @param searchVal
     * @param orgId
     * @param materialId
     * @param storageId
     * @param startTime
     * @param endTime
     * @param offset
     * @param limit
     * @return
     */
    IPage findByPage(String searchVal, Integer type, Long orgId, Long materialId, Long storageId, String startTime,
                     String endTime, Integer offset, Integer limit);

    /**
     * 根据查询
     * @param controlStorageId
     * @param time
     * @return
     */
    MaterialHistoryInventoryVo findByControlStorage(Long controlStorageId, String time);

    /**
     * 超过40天未盘存材料
     * @param orgId
     * @return
     */
    List<MaterialHistoryInventoryVo> waringInventory(String dbCode, Long orgId);
}
